package br.com.mtg.movethegarbage.game;

import br.com.mtg.movethegarbage.graphics.Sprite;

public class Tile
{
	private short tileID;
	public static int TILE_SIZE = 32;

	public static final short TILE_GRASS = 1;
	public static final short TILE_WALL = 2;
	public static final short TILE_GROUND = 3;
	public static final short TILE_TREE = 4;

	public static final short TILE_BIN_PAPER = 6;
	public static final short TILE_BIN_PLASTIC = 5;
	public static final short TILE_BIN_METAL = 7;
	public static final short TILE_BIN_GLASS = 8;
	public static final short TILE_BIN_BATTERY = 9;

	public static final short TILE_BOX_PAPER = 11;
	public static final short TILE_BOX_PLASTIC = 10;
	public static final short TILE_BOX_METAL = 12;
	public static final short TILE_BOX_GLASS = 13;
	public static final short TILE_BOX_BATTERY = 14;

	public static final short PLAYER = 15;

	public static final int NUMBER_OF_TILES = 15;

	public Tile(short _tileID)
	{
		tileID = _tileID;
	}

	public short getTileID()
	{
		return tileID;
	}

	public static Sprite getSprite(Tile tile)
	{
		switch (tile.tileID)
		{
			case TILE_GRASS:
				return Assets.SPRITE_GRASS;
			case TILE_TREE:
				return Assets.SPRITE_TREE;
			case TILE_WALL:
				return Assets.SPRITE_WALL;
			case TILE_GROUND:
				return Assets.SPRITE_GROUND;
			case TILE_BOX_PAPER:
				return Assets.SPRITE_BOX_PAPER;
			case TILE_BOX_PLASTIC:
				return Assets.SPRITE_BOX_PLASTIC;
			case TILE_BOX_METAL:
				return Assets.SPRITE_BOX_METAL;
			case TILE_BOX_GLASS:
				return Assets.SPRITE_BOX_GLASS;
			case TILE_BOX_BATTERY:
				return Assets.SPRITE_BOX_BATTERY;
			case TILE_BIN_PAPER:
				return Assets.SPRITE_BIN_PAPER;
			case TILE_BIN_PLASTIC:
				return Assets.SPRITE_BIN_PLASTIC;
			case TILE_BIN_METAL:
				return Assets.SPRITE_BIN_METAL;
			case TILE_BIN_GLASS:
				return Assets.SPRITE_BIN_GLASS;
			case TILE_BIN_BATTERY:
				return Assets.SPRITE_BIN_BATTERY;
		}
		return null;
	}

	public static Sprite getSprite(short tile)
	{
		switch (tile)
		{
			case TILE_GRASS:
				return Assets.SPRITE_GRASS;
			case TILE_TREE:
				return Assets.SPRITE_TREE;
			case TILE_WALL:
				return Assets.SPRITE_WALL;
			case TILE_GROUND:
				return Assets.SPRITE_GROUND;
			case TILE_BOX_PAPER:
				return Assets.SPRITE_BOX_PAPER;
			case TILE_BOX_PLASTIC:
				return Assets.SPRITE_BOX_PLASTIC;
			case TILE_BOX_METAL:
				return Assets.SPRITE_BOX_METAL;
			case TILE_BOX_GLASS:
				return Assets.SPRITE_BOX_GLASS;
			case TILE_BOX_BATTERY:
				return Assets.SPRITE_BOX_BATTERY;
			case TILE_BIN_PAPER:
				return Assets.SPRITE_BIN_PAPER;
			case TILE_BIN_PLASTIC:
				return Assets.SPRITE_BIN_PLASTIC;
			case TILE_BIN_METAL:
				return Assets.SPRITE_BIN_METAL;
			case TILE_BIN_GLASS:
				return Assets.SPRITE_BIN_GLASS;
			case TILE_BIN_BATTERY:
				return Assets.SPRITE_BIN_BATTERY;
		}
		return null;
	}
}
